import 'package:flutter/material.dart';

enum ConferenceItem { AddMember, LockConference, ModifyLayout, TurnoffAll }

class PopupMenuButtonSample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: Text("PopupMenuButton 示例"),
      ),
      body: Center(
        child: FlatButton(
            onPressed: () {},
            child: new PopupMenuButton(
              child: new Text("点击弹出PopupMenu"),
//              icon: Icon(Icons.expand_more),
                itemBuilder: (BuildContext context) => <PopupMenuEntry<ConferenceItem>>[
                      const PopupMenuItem<ConferenceItem>(
                        value: ConferenceItem.AddMember,
                        child: Text("添加成员"),
                      ),
                      const PopupMenuItem<ConferenceItem>(
                        child: Text("锁定会议"),
                        value: ConferenceItem.LockConference,
                      ),
                      const PopupMenuItem<ConferenceItem>(
                        child: Text("修改布局"),
                        value: ConferenceItem.ModifyLayout,
                      ),
                      const PopupMenuItem<ConferenceItem>(
                        child: Text("挂断所有"),
                        value: ConferenceItem.TurnoffAll,
                      )
                    ])),
      ),
    );
  }
}
